package csc.fresher.spring.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import csc.fresher.spring.dao.UserDAOImpl;
import csc.fresher.spring.model.User;

@Controller
@RequestMapping(value = "/listuser")
public class ListUserController {

	@Autowired
	private UserDAOImpl dao;
	
	@RequestMapping
	public String goListUser(Model model){
		List<User> listUser = dao.listUser();
		model.addAttribute("listUser", listUser);
		return "listuser";
	}
}
